//
//  PEDeviceRiseCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/11/9.
//

#import "RHDeviceDetailRiseCell.h"

@implementation RHDeviceDetailRiseCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}

-(void)setupUI
{
    kWeakSelf;
    self.contentView.backgroundColor = CFTabViewBgColor;
    UIView *bgView = kView;
    bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(0, 15, 0, 15));
    }];
    
    _titleLab = [[QMUILabel alloc]init];
    _titleLab.text = @"Temperature:";
    _titleLab.font = [UIFont systemFontOfSize:13];
    _titleLab.textAlignment = NSTextAlignmentLeft;
    _titleLab.textColor = [UIColor colorWithHexString:@"3F4443" alpha:0.6];
    [bgView addSubview:_titleLab];
    
    _contentLab = [[QMUILabel alloc]init];
    _contentLab.text = @"2.5℃";
    _contentLab.font = [UIFont systemFontOfSize:13];
    _contentLab.textAlignment = NSTextAlignmentLeft;
    _contentLab.textColor = [UIColor colorWithHexString:@"3F4443" alpha:0.8];
    [bgView addSubview:_contentLab];
    
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_offset(15);
            make.centerY.mas_offset(0);
    }];
    
    [_contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-15);
        make.centerY.mas_offset(0);
    }];
    
    
    UIImageView *arrowImg = [[UIImageView alloc]init];
    arrowImg.image = [UIImage imageNamed:@"block_power_up"];
    [bgView addSubview:arrowImg];
    [arrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.equalTo(@(CGSizeMake(15, 15)));
        make.right.equalTo(weakSelf.contentLab.mas_left).offset(-5);
        make.centerY.mas_offset(0);
    }];
}
@end
